import { View } from "@tarojs/components";
import { Icon } from "@antmjs/vantui";
import React from "react";
import './index.scss'

const CusCard = ({ top_left_tit, top_leftView, top_rightView, children, right_icon_name,headClick}) => {
    return (
        <View onClick={(e)=>{
            e.stopPropagation()
            if(headClick){
                headClick()
            }
        }} className="card-bg">
            <View className="top-view">
                {top_leftView ? top_leftView : <View className="left-view">{top_left_tit}</View>}
                {top_rightView ? top_rightView : <View>
                    <Icon color="#8D949D" size={35} name={right_icon_name || "arrow"} />
                </View>}
            </View>
            <View className="child-view">
                {children}
            </View>
        </View>
    )
}

export default CusCard